package com.mobile.collect.beans;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by gwy on 2017/9/26.
 */

public class SpinnerItem implements Parcelable {
    private String name;
    private String value;
    private String relation;//关联字段
    private String ismust;//关联字段的显示或隐藏

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return name;
    }

    public SpinnerItem() {
    }

    public SpinnerItem(String name, String value, String ismust) {
        this.name = name;
        this.value = value;
        this.ismust = ismust;
    }

    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }

    public String getIsmust() {
        return ismust;
    }

    public void setIsmust(String ismust) {
        this.ismust = ismust;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.value);
        dest.writeString(this.relation);
        dest.writeString(this.ismust);
    }

    protected SpinnerItem(Parcel in) {
        this.name = in.readString();
        this.value = in.readString();
        this.relation = in.readString();
        this.ismust = in.readString();
    }

    public static final Creator<SpinnerItem> CREATOR = new Creator<SpinnerItem>() {
        @Override
        public SpinnerItem createFromParcel(Parcel source) {
            return new SpinnerItem(source);
        }

        @Override
        public SpinnerItem[] newArray(int size) {
            return new SpinnerItem[size];
        }
    };
}
